﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ATM.BUS;
using ATM.Entities;
using ATM.DAO;

namespace ATM.UnitTest
{
    [TestFixture()]
    public class InsertPINUT
    {
        private string case1 = "123456", case2 = "666666";
        private Card card;
        private int count = 0;

        [SetUp]
        public void SetUp()
        {
            card=CardDAO.GetCurrentCard("111111111111AAAA");
        }

        [TestCase]
        public void TestWrongPIN()
        {
            Assert.AreEqual(ValidationBUS.Authentication(card, case1, count),1);
        }

        [TestCase]
        public void TestCorrectPIN()
        {
            Assert.AreEqual(ValidationBUS.Authentication(card, case2, count), 0);
        }

        [TestCase]
        public void TestBlockCard()
        {
            Card tempCard = CardDAO.GetCurrentCard("987654321ABCDEFG");
            Assert.AreEqual(ValidationBUS.Authentication(tempCard, "", 3), 2);
        }
    }
}
